<template>
	<view>
		<u-cell-group>
			<u-cell-item v-for="(item, index) in bankList" :title="item.name" @click="click(item.bankId)" :key="item.bankId">
				<template v-slot:icon>
					<u-image width="80rpx" height="80rpx" :src="item.iconUrl">
					</u-image>
				</template>
			</u-cell-item>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bankList: [],
				groupType: -1
			}
		},
		onLoad(query) {
			this.bankList = this.$api.getBankList();
			this.groupType = query.gType;
		},
		methods: {
			click(bankId) {
				let url = "credit_account?bankId=" + bankId;

				if(this.groupType == 2){
					url = "debit_account?bankId=" + bankId;
				}
				uni.navigateTo({
					url: url
				})
			}
		},
	}
</script>

<style lang="scss">

</style>
